import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/about',
    name: 'about',
    component: () => import( '../views/About.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import( '../views/login.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import( '../views/register.vue'),
  },
  
  {
    path:'/myshopcar',
    name:'myshopcar',
    component:() => import('../views/MyShopCar.vue'),
    children:[
      {path:'/myshopcar',name:'shopcar',component:()=> import('../views/ShopCar.vue')},
      {path:'/myshopcar/shopcar',name:'shopcar',component:()=> import('../views/ShopCar.vue')},
      {path:'/myshopcar/orderconfirm',name:'orderconfirm',component:()=>import('../views/OrderComfir.vue')},
      {path:'/myshopcar/suborder',name:'suborder',component:()=>import('../views/SubOrder.vue')}
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
